<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class VirtualLabs_Admin_MiembroLaboratorio extends VirtualLabs_Admin_Dao {

    const TABLE_NAME = 'miembro_laboratorio';

    /**
     * Metodo que devuelve roles segun un criterio.
     * @param type $fields
     * @param type $where
     * @return type
     * @throws Exception
     */
    public function getMiembrosLaboratorioAlumno($fields = array(), $where = array()) {
        $db = Zend_Db_Table::getDefaultAdapter();
        $select = $db->select()->from(VirtualLabs_Admin_MiembroLaboratorio::TABLE_NAME, $fields);
        foreach ($where as $key => $value) {
            $select->where("$key {$value['criteria']} ?", $value['value']);
        }
        try {
            return $db->fetchAll($select);
        } catch (Exception $e) {
            $logger = Zend_Registry::get(VirtualLabs_Exception::ERROR_LOG);
            $logger->err($e->getMessage());
            $logger->err($e->getTraceAsString());
            throw $e;
        }
    } 
        
}

?>
